function request(url,type,data){
    let token = sessionStorage.getItem("Token");
    let response;
    $.ajax({
        url:url,                //路径
        type:type,              //请求类型
        dataType:'json',        //响应数据类型
        data:data,              //请求携带参数
        async:false,            //关闭异步
        beforeSend(xhr){
            let split = url.split("/");
            if(split[split.length-1]!=="login")
            xhr.setRequestHeader("Token",token)
        },
        success:function (res){
            //如果没有登录，则进行跳转登录页
            if(res.msg==='noLogin'){
                window.top.location.replace('../admin/login.html')
            }else if(res.msg==='noAuthorize'){
                layer.alert("权限不足！", {
                        icon: 7
                    },
                    function (index) {
                        //关闭当前alert
                        layer.close(index);
                    });
                return;
            }
                response=res;
        }
    })
    return response;
}